/**
 * Description:一些注释<br/>
 * CreateTime:2019-03-28<br/>
 * Creater: yangpengfei360@126.com <br/>
 * @author yangpengfei
 */
package cn.cnsy123.bookwebsiteserver.controller.user;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import com.google.code.kaptcha.Constants;

import cn.cnsy123.bookwebsiteserver.constant.CacheConstant;

/**
 * Description:一些注释<br/>
 * CreateTime:2019-03-28<br/>
 * Creater: yangpengfei360@126.com <br/>
 * @author yangpengfei
 */
@Controller
public class LoginOutController {
    
    
    @GetMapping(value = "/logout")
    public String loginOut(HttpServletRequest request) {
        HttpSession session = request.getSession();
        session.removeAttribute(CacheConstant.SESSION_USER);
        session.removeAttribute(Constants.KAPTCHA_SESSION_KEY);
        session.invalidate();
        return "redirect:/loginPage";
    }

}
